<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>父 件和子组件的区分</title>
</head>
<body>
    <div id="app">
        <cpn2></cpn2>
    </div>
</body>
    <script src="../js/vue.js"></script>
    <script>
        //子组件
        const cpnC1 = Vue.extend({
            template: `
                <div>
                    <h2>标题1</h2>
                    <p>段落1</p>
                    <p>段落2</p>
                </div>
            `
        })

        //父组件
        const cpnC2 = Vue.extend({
            template: `
                <div>
                    <h2>标题2</h2>
                    <p>段落3</p>
                    <p>段落4</p>
                    <cpn1></cpn1>
                </div>
            `,
            components: {
                cpn1: cpnC1,
            }
        })

        //root组件
        const app = new Vue({
            el: '#app',
            data: {
                message: 'hello',
            },
            methods: {

            },
            components: {
                cpn2: cpnC2,
            }
        })
    </script>
</html>